<%@ page import="sar.StudentAttendant"%>
<!DOCTYPE html>
<html>
<head>
<meta name="layout" content="main">
<g:set var="entityName"
	value="${message(code: 'studentAttendant.label', default: 'StudentAttendant')}" />
<title><g:message code="default.list.label" args="[entityName]" /></title>
</head>
<body>
	<%--<a href="#list-studentAttendant" class="skip" tabindex="-1"><g:message
			code="default.link.skip.label" default="Skip to content&hellip;" /></a>
	<div class="nav" role="navigation">
		<ul>

			<li><g:link class="create" action="create">
					<g:message code="default.new.label" args="[entityName]" />
				</g:link></li>
		</ul>
	</div>
	--%>
	<div id="list-studentAttendant" class="content scaffold-list"
		role="main">
		<%--<h1>
			<g:message code="default.list.label" args="[entityName]" />
		</h1>
		--%>
		<g:if test="${flash.message}">
			<div class="message" role="status">
				${flash.message}
			</div>
		</g:if>
		<g:form action="list" method="GET">
			<div class="searchForm">
				<label for="course"> <g:message
						code="programCourse.course.label" default="Course" /> <span
					class="required-indicator">*</span>
				</label>
				<g:select id="course" name="course.id" from="${sar.Course.list()}"
					optionKey="id" required=""
					value="${sobj?.programCourse?.course?.id}" class="many-to-one" />
				<label for="program"> <g:message
						code="programCourse.program.label" default="Program" /> <span
					class="required-indicator">*</span>
				</label>
				<g:select id="program" name="program.id"
					from="${sar.Program.list()}" optionKey="id" required=""
					value="${sobj?.programCourse?.program?.id}" class="many-to-one" />
				<label for="time"> <g:message
						code="teachingSession.time.label" default="Time" /> <span
					class="required-indicator">*</span>
				</label>
				<g:datePicker name="time" precision="minute" value="${sobj?.time}" />
				<g:submitButton name="Search" value="search" />
			</div>
		</g:form>
		<g:form action="attendant">
			<table>
				<thead>
					<tr>

						<g:sortableColumn property="attendant"
							title="${message(code: 'studentAttendant.attendant.label', default: 'Attendant')}" />
						<th>Absent</th>

						<th><g:message code="studentAttendant.studentCourse.label"
								default="Student Course" /></th>

						<th><g:message code="studentAttendant.teachingSession.label"
								default="Teaching Session" /></th>
						<th><g:message
								code="studentAttendant.teachingSession.time.label"
								default="Time" /></th>

					</tr>
				</thead>
				<tbody>
					<g:each in="${studentAttendantInstanceList}" status="i"
						var="studentAttendantInstance">
						<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">
							<g:radioGroup name="${studentAttendantInstance?.id }"
								values="[true,false]"
								value="${studentAttendantInstance?.attendant }">
								<td>
									${it.radio}
								</td>
							</g:radioGroup>
							<td>
								${fieldValue(bean: studentAttendantInstance, field: "studentCourse")}
							</td>

							<td>
								${fieldValue(bean: studentAttendantInstance, field: "teachingSession")}
							</td>
							<td>
								${fieldValue(bean: studentAttendantInstance, field: "teachingSession.time")}
							</td>

						</tr>
						<input type="hidden" name="${studentAttendantInstance.id}"
							value="${studentAttendantInstance.attendant}" />
					</g:each>

				</tbody>
			</table>
			<g:submitButton name="Save" value="Save" />
		</g:form>
		<div class="pagination">
			<g:paginate total="${studentAttendantInstanceTotal}" />
		</div>
	</div>
</body>
</html>
